{% extends 'resume_manage/base_information.html' %}

{% load static %}

{% block content %}
<div class="container">
    <h2>教育经历</h2>
    <form id="education-form" method="post">
        {% csrf_token %}
        <div class="experience-item">
            <div class="form-group">
                <label for="school">学校名称</label>
                <input type="text" class="form-control" id="school" name="school" required value="{{ form.school }}">
            </div>

            <div class="form-group">
                <label for="major">专业</label>
                <input type="text" class="form-control" id="major" name="major" required value="{{ form.major }}">
            </div>

            <div class="form-group">
                <label for="degree">学历/学位</label>
                <select class="form-control" id="degree" name="degree" required >
                    <option value="">请选择</option>
                    <option value="专科" {% if form.degree == '专科' %}selected{% endif %}>专科</option>
                    <option value="本科" {% if form.degree == '本科' %}selected{% endif %}>本科</option>
                    <option value="硕士" {% if form.degree == '硕士' %}selected{% endif %}>硕士</option>
                    <option value="博士" {% if form.degree == '博士' %}selected{% endif %}>博士</option>
                </select>
            </div>

            <div class="form-group">
                <label for="start_date">入学时间</label>
                <input type="date" class="form-control" id="start_date" name="start_date" required value="{{ form.start_date }}">
            </div>

            <div class="form-group">
                <label for="end_date">毕业时间</label>
                <input type="date" class="form-control" id="end_date" name="end_date" required value="{{ form.end_date }}">
            </div>

            <div class="form-group">
                <label for="gpa">GPA/平均分</label>
                <input type="text" class="form-control" id="gpa" name="gpa" value="{{ form.gpa }}">
            </div>

            <div class="form-group">
                <label for="description">在校表现</label>
                <textarea class="form-control" id="description" name="description" rows="3">{{ form.description }}</textarea>
            </div>
        </div>
        <a href="#" class="add-section" id="add-education"><i class="fas fa-plus-circle"></i> 添加教育经历</a>


        <div class="action-buttons">
            <button type="submit" class="btn btn-primary" id="save-education">保存</button>
        </div>
    </form>
</div>

<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="{% static 'js/education_experience.js' %}"></script>
{% endblock %}